 <?php
/**
 * WinBoardRankList
 * @Funtion: 获取总赢取局数排行榜
 * @auth : guobin
 * @time : 2014-10-27
 */

class WinBoardRankList extends APIBase {
		
	public $tag = "WinBoardRankList";
	public $isLogin = false;
		
	public function before() {
		$this->initCacheRedis();
		return true;
	}

	public function logic() {
			
		for ($i=0; $i<30; $i++) 
		{
			$rank = $this->cache_redis->hMGet("hWinboardRank:{$i}", array("num","uid", "name", "sex", "total_win"));
			$rank["uid"] = (int)$rank["uid"];
			$rank["sex"] = (int)$rank["sex"];
			$rank["num"] = (int)$rank["num"];
			$rank["total_win"] = (int)$rank["total_win"];
			$ranks[] = $rank;
		}
		$this->returnData(array('ranks' => $ranks),0,"总赢取局数排行榜");
	}
		
    	public function after() {
		$this->deinitCacheRedis();
	}
    }
?>
